require 'tk'

root = TkRoot.new {title "hello world"}
var = TkVariable.new
txt = TkEntry.new {
	text var
	pack side:"left"
}
btn = TkButton.new {
	text "click me"
	command {
		puts "val is #{var.value} : #{(rand*10000%1000).to_i}"
	}
	pack side:"right"
}
btn.invoke
#x = ->{puts "hello world"}
x=proc {puts "hello world"}
btn.configure(command:->{puts "best boy!!!"})
Tk.mainloop
btn.destroy